#ifndef DSPSIMULATOR_INSTFETCHER_H
#define DSPSIMULATOR_INSTFETCHER_H

#include <memory>
#include <simulator/targetMachine/targetMachine.h>
#include <simulator/instruction/instInfo.h>

/**
 * 取指器
 */
class InstFetcher {
protected:
    std::shared_ptr<TargetMachine> m_targetMachine; // 目标机
public:
    explicit InstFetcher(std::shared_ptr<TargetMachine> targetMachine) : m_targetMachine(targetMachine) {}

    virtual ~InstFetcher() = default;

    /**
     * 从内存中取出一条指令数据
     * @return 一条指令数据
     */
    virtual std::shared_ptr<InstInfo> fetchOneInstruction() = 0;
};

#endif //DSPSIMULATOR_INSTFETCHER_H
